 <!DOCTYPE html>
 <html>

 <head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    <title>{$Think.config.site.title} - 取消采购商品</title>

    <meta name="keywords" content="{$Think.config.site.keywords}">

    <link href="{$Think.config.site.resource_url}css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/animate.min.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/style.min.css?v=4.0.0" rel="stylesheet">

</head>
<style>
#listtable .fa{
	cursor:pointer;
	color:#1ab394;
	margin-right:1em;
}
th .tag{font-size: 12px; color: #e66c6c; font-weight: normal;}
.ibox-title .tag{font-size: 12px; color: #e66c6c; font-weight: normal; display: inline-block; margin-left: 20px;}
.specval-hide{display: none;}

@media print{
	.notprint{display: none;}
	*{padding: 0 !important; margin:0 !important;}
}
</style>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">

      <div class="row notprint">
        <div class="col-sm-4">
            <button type="button" class="btn btn-primary btn-sm delall" > 删除</button>
        </div>
    </div>
    <div class="row">
      <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                        <!-- <div class="row notprint">
                        	<div class="col-sm-6">
                        	</div>
                          	<div class="col-sm-6">
                                <div class="input-group pull-right">
                                <form action="{:url('index')}" method="get" enctype="application/x-www-form-urlencoded">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入关键词" class="input-sm form-control" value="{$Think.get.keywords ?? ''}" name="keywords">
                                    <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                </div>
                                </form>
                                </div>
                            </div>
                            
                        </div> -->
                        <div class="table-responsive">
                            <table class="table table-striped" id="listtable">
                                <thead>
                                    <tr>
                                        <th class="notprint" width="30"><input name="checkall" id="checkall"  type="checkbox" class="i-checks" value="1"></th>
                                        <th class="notprint" width="150">商品图片</th>
                                        <th width="">商品名称<span class="tag">（点击展开）</span></th>
                                        <th width="200">采购员</th>
                                        <th>采购数量</th>
                                        <th>取消时间</th>
                                        <th>备注</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>

                                	{volist name="list" id="vo"}
                                    <tr data-id="{$vo.goods_id}" data-specval_id="{$vo.specval_id}" data-pg_id="{$vo.pg_id}">
                                        <td class="notprint" >
                                            <input name="ids[]"  type="checkbox" class="i-checks" value="{$vo.goods_id}">
                                        </td>
                                        <td class="notprint" ><img src="{$vo.picture}" width="30" height="30"></td>
                                        <td class="goodsname">（{$vo.brand_name}）{$vo.goods_name}&nbsp;&nbsp;[&nbsp;1*{$vo.spec_name}&nbsp;({$vo.specval_name})&nbsp;]</td>
                                        <td>{$vo.employee_name}</td>
                                        <td>{$vo['num']}{$vo.spec_name}</td>
                                        <td>{$vo.cancel_time}</td>
                                        <td>{$vo.remark}</td>
                                        <td>
                                        	<button class="btn btn-primary btn-sm del">删除</button>
                                        </td>
                                    </tr>
                                    {volist name="vo['data']" id="v"}
                                    <tr class="tr-specval specval-{$vo.goods_id} specval-hide">
                                        <td></td>
                                        <td>{$v.order_no}</td>
                                        <td>{$v.receiver_name}</td>
                                        <td>{$v.create_time}</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    {/volist}
                                    {/volist}

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <script src="{$Think.config.site.resource_url}js/jquery.min.js?v=2.1.4"></script>
    <script src="{$Think.config.site.resource_url}js/bootstrap.min.js?v=3.3.5"></script>
    <script src="{$Think.config.site.resource_url}js/plugins/peity/jquery.peity.min.js"></script>
    <script src="{$Think.config.site.resource_url}js/plugins/iCheck/icheck.min.js"></script>
    <script src="{$Think.config.site.resource_url}js/plugins/layer/layer.js"></script>
    <script src="{$Think.config.site.common_resource_url}js/majax.js"></script>
    <script src="{$Think.config.site.common_resource_url}js/jedit.js"></script>
</body>

</html>
<script>

    var layer_font='';
    $(document).ready(function() {

       $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",});

	//全选
	$("#checkall").bind("ifChecked",function(){
		$("input[name='ids[]']").iCheck("check");
	});
	//取消全选
	$("#checkall").bind("ifUnchecked",function(){
		$("input[name='ids[]']").iCheck("uncheck");
	});

    $('.delall').click(function(){
    	var list = [],goods='';
        $("input[name='ids[]']:checked").each(function(index, element) {
            list.push($(this).closest("tr").data("pg_id"));
            
        });
        if(list.length < 1) {
            layer.msg('请至少选中一项', {icon: 5});
            return false;
        }

        majax('{:url("delCancel")}',{pg_id:list.join(',')},function(re){
            if (re==0) {
                layer.msg(re.msg,{icon:2});
            }
        })
    })

    $('.del').click(function(){
    	var pg_id = $(this).closest('tr').data('pg_id');
        majax('{:url("delCancel")}',{pg_id:pg_id},function(re){
            if (re==0) {
                layer.msg(re.msg,{icon:2});
            }
        })
    })
    $('.goodsname').click(function(){
        var id=$(this).closest('tr').data('id');
        $('.specval-'+id).toggleClass('specval-hide');
    })
});	
</script>